package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("service1")
public class WebController {

    @RequestMapping("setMsg")
    public String  setMsg(HttpSession session) {

        session.setAttribute("msg", "Hello SpringSession!");
        return "ok";
    }
}

